// OGoMojo
// Whitemice.MOGI.IServer
// License: LGPL
// Copyright: Whitemice Consulting, 2006
// Author(s): Adam Tauno Williams (awilliam@whitemice.org)
using System;
using System.Net;
using System.Web;
using System.Collections;
using log4net;

namespace Whitemice.MOGI
{
	public interface IServer
	{
		bool Connected { get; }
		NetworkCredential Credentials { get; set; }
		string Hostname { get; set; }
		ArrayList Search(string criteria, int max);
		ArrayList Search(string criteria);
		IMOGIObject Get(string documentId);
		void Put(IMOGIObject document);
		void Remove(IDocument document);
		void Remove(string documentId);
		ICollection PhoneTypes(DocumentType docType);
		ICollection AddressTypes(DocumentType docType);
		ICollection ExtendedAttributes(DocumentType docType);
		bool SupportsAttribute(DocumentType docType, string attribute);
		bool SupportsAddress(DocumentType docType, string attribute);
		bool SupportsPhone(DocumentType docType, string attribute);
		bool SupportsProperty(DocumentType docType, string property);
		bool AllowsWrite(string documentId);
		bool AllowsRead(string documentId);
		void SetRights(string documentId, Rights[] rights);
		void SetRight(string documentId, Rights rights);
		void SetRight(string documentId, string actorId, bool write, bool read);
		ArrayList Rights(string documentId);
		bool HasRight(string actorDocumentId, string objectDocumentId, string privilege);
		ILog Log { get; set; }
		string GetDirectiveValue(string stanza, string directive);
		bool SupportsOperation(DocumentType docType, Operation operation);
		bool IsBusy(string documentId, DateTime start, DateTime end);
		IAccount CurrentActor { get; }
		ICache Cache { get; set; }
		string GetName(string primaryKey);
	}
}
